<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>


<script type="text/javascript">

        function factorial(num){
            if (num<=1) {
            	return 1;
            }else{
            	return num * arguments.callee(num-1);
            	//arguments.callee调用自身函数。实现递归
            }
        }

        alert(factorial(10))

</script>

</head>
<body>
	
</body>
</html>